package com.example.tian.mvpforurse.di.module;

import android.content.Context;
import android.support.v7.app.AppCompatActivity;

import com.example.tian.mvpforurse.di.ActivityContext;
import com.example.tian.mvpforurse.utils.rx.AppSchedulerProvider;
import com.example.tian.mvpforurse.utils.rx.SchedulerProvider;

import dagger.Module;
import dagger.Provides;
import io.reactivex.disposables.CompositeDisposable;

/**
 * @author tian
 */

@Module
public class ActivityModule {

    private AppCompatActivity mActivity;

    public ActivityModule(AppCompatActivity activity){
        this.mActivity = activity;
    }

    @Provides
    @ActivityContext
    Context provideContext(){
        return mActivity;
    }

    @Provides
    AppCompatActivity provideActivity(){
        return mActivity;
    }

    @Provides
    CompositeDisposable provideCompositeDisposable(){
        return new CompositeDisposable();
    }

    @Provides
    SchedulerProvider provideSchedulerProvider(){
        return new AppSchedulerProvider();
    }



}
